package com.ulife.category.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ulife.category.dao.PropertyValueDao;
import com.ulife.category.dao.dataobject.PropertyValueDo;

public class PropertyValueDaoImpl extends SqlMapClientDaoSupport implements PropertyValueDao {

	@SuppressWarnings("unchecked")
	public List<PropertyValueDo> queryPropertyValuesByPId(Long pId) throws SQLException {
		return getSqlMapClient().queryForList("PropertyValue.queryPropertyValuesByPId", pId);
	}

	public int deletePropertyValueByIds(List<Long> pvid) throws SQLException {
		return getSqlMapClientTemplate().delete("PropertyValue.deletePropertyValueByIds", pvid);
	}

	public int deletePropertyValueByPid(Long pId) throws SQLException {
		return getSqlMapClientTemplate().delete("PropertyValue.deletePropertyValueByPid", pId);
	}

	public Long insertPropertyValue(PropertyValueDo pv) throws SQLException {
		return (Long) getSqlMapClientTemplate().insert("PropertyValue.insertPropertyValue", pv);
	}

	public PropertyValueDo queryPropertyValuesByPvId(Long pvId) throws SQLException {
		return (PropertyValueDo) getSqlMapClient().queryForObject("PropertyValue.queryPropertyValuesByPvId", pvId);
	}

}
